"),this.$body.append(this.$elm),s=function(o,t){t.elm.remove()},this.showSpinner(),e.trigger(o.modal.AJAX_SEND),o.get(l).done(function(i){t&&(e.trigger(o.modal.AJAX_SUCCESS),t.$elm.empty().append(i).on(o.modal.CLOSE,s),t.hideSpinner(),t.open(),e.trigger(o.modal.AJAX_COMPLETE))}).fail(function(){e.trigger(o.modal.AJAX_FAIL),t.hideSpinner(),e.trigger(o.modal.AJAX_COMPLETE)});else this.$elm=e,this.$body.append(this.$elm),this.open()},o.modal.prototype={constructor:o.modal,open:function(){var t=this;this.options.doFade?(this.block(),setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay)):(this.block(),this.show()),this.options.escapeClose&&o(document).on("keydown.modal",function(t){27==t.which&&o.modal.close()}),this.options.clickClose&&this.blocker.click(function(t){t.target==this&&o.modal.close()})},close:function(){this.unblock(),this.hide(),o(document).off("keydown.modal")},block:function(){this.$elm.trigger(o.modal.BEFORE_BLOCK,[this._ctx()]),this.blocker=o(''),this.$body.css("overflow","hidden"),this.$body.append(this.blocker),this.options.doFade&&this.blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(o.modal.BLOCK,[this._ctx()])},unblock:function(){if(this.options.doFade){var o=this;this.blocker.fadeOut(this.options.fadeDuration,function(){o.blocker.children().appendTo(o.$body),o.blocker.remove(),o.$body.css("overflow","")})}else this.blocker.children().appendTo(this.$body),this.blocker.remove(),this.$body.css("overflow","")},show:function(){this.$elm.trigger(o.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=o(''+this.options.closeText+""),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass+" current"),this.$elm.appendTo(this.blocker),this.options.doFade?this.$elm.css("opacity",0).show().animate({opacity:1},this.options.fadeDuration):this.$elm.show(),this.$elm.trigger(o.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(o.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove(),this.$elm.removeClass("current");var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(o.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||o('').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,blocker:this.blocker,options:this.options}}},o.modal.close=function(o){if(t){o&&o.preventDefault(),t.close();var e=t.$elm;return t=null,e}},o.modal.isActive=function(){return t?!0:!1},o.modal.defaults={escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",spinnerHtml:null,showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},o.modal.BEFORE_BLOCK="modal:before-block",o.modal.BLOCK="modal:block",o.modal.BEFORE_OPEN="modal:before-open",o.modal.OPEN="modal:open",o.modal.BEFORE_CLOSE="modal:before-close",o.modal.CLOSE="modal:close",o.modal.AFTER_CLOSE="modal:after-close",o.modal.AJAX_SEND="modal:ajax:send",o.modal.AJAX_SUCCESS="modal:ajax:success",o.modal.AJAX_FAIL="modal:ajax:fail",o.modal.AJAX_COMPLETE="modal:ajax:complete",o.fn.modal=function(e){return 1===this.length&&(t=new o.modal(this,e)),this},o(document).on("click.modal",'a[rel="modal:close"]',o.modal.close),o(document).on("click.modal",'a[rel="modal:open"]',function(t){t.preventDefault(),o(this).modal()})}(jQuery);;
jQuery(document).ready(function(){
//Função que faz a animação das miniaturas das fotos do produto
jQuery(".itemFotoMiniatura").live('click', function() {
jQuery(".itemFotoMiniatura").children(".hoverItemFotoMiniatura").removeClass("hoverItemFotoMiniaturaClicado");
jQuery(this).children(".hoverItemFotoMiniatura").addClass("hoverItemFotoMiniaturaClicado");
});
//Função responsavel por esconder o item "SELECIONE" do Selectbox
$(".itemSubproduto").click(function() {
$(this).siblings(".itemSelecioneLista").remove();
});
//Função que limita o scroll das imagens travando a exibição na última ou na primeira imagem quando o limite do scroll for atingido
/*jQuery(".setaCimaMiniaturas").live('click', function () {
jQuery(this).siblings(".boxItensFotosMiniaturas").children(".slideItensFotosMiniaturas").css("margin-top", "-=90px").delay(1200);
setTimeout(
function()
{
var marginTop = parseInt(jQuery(".slideItensFotosMiniaturas").css("margin-top"), 10);
var altura_box_miniaturas = parseInt(jQuery(".slideItensFotosMiniaturas").height(), 10);
var marginIdeal = parseInt(altura_box_miniaturas, 10) -84;
var margemPositiva = Math.abs(marginTop);
var margemIdealNegativa = -Math.abs(marginIdeal);
if (margemPositiva > marginIdeal) {
jQuery(".slideItensFotosMiniaturas").css({marginTop: margemIdealNegativa + 'px'});
}
}, 500);
});*/
$('.setaBaixoMiniaturas').on('click', function(){
$(this).siblings('.containerListagemProdutosMini').children('.boxItensFotosMiniaturas').animate({ scrollTop: '+=90px' }, "fast");
});
//Função que limita o scroll das imagens travando a exibição na última ou na primeira imagem quando o limite do scroll for atingido
$('.setaCimaMiniaturas').on('click', function(){
$(this).siblings('.boxItensFotosMiniaturas').animate({ scrollTop: '-=90px' }, "fast");
});
/*jQuery(".setaBaixoMiniaturas").live('click', function () {
jQuery(this).parent().find(".slideItensFotosMiniaturas").css("margin-top", "+=90px");
setTimeout(
function()
{
var marginTop = parseInt(jQuery(".slideItensFotosMiniaturas").css("margin-top"), 10);
if (marginTop >= 0) {
jQuery(".slideItensFotosMiniaturas").css("margin-top", "0");
}
}, 500);
});*/
//Função responsável por fechar o dropdown de subprodutos quando clicar em qualquer lugar da página que não seja ele mesmo
jQuery("body, .boxModeloItemSubprodutoLista").live('click', function(){
var alturaDropdownSubprodutos = jQuery(".exibeItemsSubprodutoLista").height();
if (alturaDropdownSubprodutos > 50){
jQuery(".exibeItemsSubprodutoLista").removeClass("exibeItemsSubprodutoLista");
jQuery(".alturaDoisElementos").removeClass("alturaDoisElementos");
jQuery(".alturaTresElementos").removeClass("alturaTresElementos");
jQuery(".boxModeloItemSubprodutoLista ").removeClass("alturaScrollElementos");
}
});
//Função responsável por mostrar os itens de subproduto em dropdown
jQuery(".boxModeloItemSubprodutoLista").live('click', function() {
jQuery(this).toggleClass("exibeItemsSubprodutoLista");
jQuery(this).parent().parent().siblings().find(".boxModeloItemSubprodutoLista").removeClass("exibeItemsSubprodutoLista");
var numElementosFilhos = jQuery(this).children(".modeloItemSubprodutoLista").length;
if (numElementosFilhos == 2) {
jQuery(this).toggleClass("alturaDoisElementos");
}
else if (numElementosFilhos == 3) {
jQuery(this).toggleClass("alturaTresElementos");
}
else if (numElementosFilhos > 3) {
jQuery(this).toggleClass("alturaScrollElementos");
}
});
//Função que sobe o scroll quando um item de Subproduto é selecionado
jQuery(".modeloItemSubprodutoLista").live('click', function() {
var alturaDropdownPai = jQuery (this).parent().height();
if (alturaDropdownPai > 50){
jQuery(this).parent().scrollTop( 0 );
jQuery(this).toggleClass("itemSubprodutoListaSelecionado");
jQuery(this).siblings().removeClass("itemSubprodutoListaSelecionado");
jQuery(this).addClass("valorItemSelecionado");
jQuery(this).siblings().removeClass("valorItemSelecionado");
jQuery(this).trigger('change');
}
});
(function selectboxInit() {
var $itemSelecionado = jQuery(".modeloItemSubprodutoLista").find(".valorItemSelecionado");
if($itemSelecionado.length) {
jQuery(".modeloItemSubprodutoLista:first").addClass("valorItemSelecionado");
}
//Função que altera o atributo Css flex-grow: de 1 para 0 quando o subproduto contiver apenas foto
jQuery('.modeloItemSubprodutoExpandido').each(function() {
if(jQuery(this).find('.conteudoModeloItemSubprodutoExpandido').length == 0) {
jQuery(this).css("flex-grow", "0");
}
});
var marginTop = parseInt(jQuery(".slideItensFotosMiniaturas").css("margin-top"), 10);
if (marginTop >= 0) {
jQuery(".slideItensFotosMiniaturas").css("margin-top", "0");
}
})();
jQuery(document).on('click', function(){
$('.boxModeloItemSubprodutoLista').scrollTop(0);
});
});;
// jQuery Mask Plugin v1.14.16
// github.com/igorescobar/jQuery-Mask-Plugin
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,n,f){a instanceof String&&(a=String(a));for(var p=a.length,k=0;k
g?h=10*d:e>=h&&e!==g?c.maskDigitPosMapOld[h]||(e=h,h=h-(k-l)-a,c.maskDigitPosMap[h]&&(h=e)):h>e&&(h=h+(l-k)+f)}return h},behaviour:function(d){d=
d||window.event;c.invalid=[];var e=b.data("mask-keycode");if(-1===a.inArray(e,l.byPassKeys)){e=c.getMasked();var h=c.getCaret(),g=b.data("mask-previus-value")||"";setTimeout(function(){c.setCaret(c.calculateCaretPosition(g))},a.jMaskGlobals.keyStrokeCompensation);c.val(e);c.setCaret(h);return c.callbacks(d)}},getMasked:function(a,b){var h=[],f=void 0===b?c.val():b+"",g=0,k=d.length,n=0,p=f.length,m=1,r="push",u=-1,w=0;b=[];if(e.reverse){r="unshift";m=-1;var x=0;g=k-1;n=p-1;var A=function(){return-1<
g&&-1b-e&&(f=new RegExp("\\.?0{1,"+(d-(b-e))+"}$"),h=h.replace(f,"")),h}function c(a,b,c){var j;return j=0===a._value&&null!==s.zeroFormat?s.zeroFormat:null===a._value&&null!==s.nullFormat?s.nullFormat:b.indexOf("$")>-1?d(a,b,c):b.indexOf("%")>-1?e(a,b,c):b.indexOf(":")>-1?h(a,b):b.indexOf("b")>-1||b.indexOf("ib")>-1?f(a,b,c):b.indexOf("o")>-1?g(a,b,c):i(a._value,b,c)}function d(a,b,c){var d,e,f=b.indexOf("$"),g=b.indexOf("("),h=b.indexOf("-"),j="";return b.indexOf(" $")>-1?(j=" ",b=b.replace(" $","")):b.indexOf("$ ")>-1?(j=" ",b=b.replace("$ ","")):b=b.replace("$",""),e=i(a._value,b,c,!1),1>=f?e.indexOf("(")>-1||e.indexOf("-")>-1?(e=e.split(""),d=1,(g>f||h>f)&&(d=0),e.splice(d,0,q[s.currentLanguage].currency.symbol+j),e=e.join("")):e=q[s.currentLanguage].currency.symbol+j+e:e.indexOf(")")>-1?(e=e.split(""),e.splice(-1,0,j+q[s.currentLanguage].currency.symbol),e=e.join("")):e=e+j+q[s.currentLanguage].currency.symbol,e}function e(a,b,c){var d,e="",f=100*a._value;return b.indexOf(" %")>-1?(e=" ",b=b.replace(" %","")):b=b.replace("%",""),d=i(f,b,c),d.indexOf(")")>-1?(d=d.split(""),d.splice(-1,0,e+"%"),d=d.join("")):d=d+e+"%",d}function f(a,b,c){var d,e,f,g,h=b.indexOf("ib")>-1?t.iec:t.bytes,j=a._value,k="";for(b.indexOf(" b")>-1||b.indexOf(" ib")>-1?(k=" ",b=b.replace(" ib","").replace(" b","")):b=b.replace("ib","").replace("b",""),e=0;e<=h.length;e++)if(f=Math.pow(1024,e),g=Math.pow(1024,e+1),null===j||0===j||j>=f&&g>j){k+=h[e],f>0&&(j/=f);break}return d=i(j,b,c),d+k}function g(a,b,c){var d,e="";return b.indexOf(" o")>-1?(e=" ",b=b.replace(" o","")):b=b.replace("o",""),e+=q[s.currentLanguage].ordinal(a._value),d=i(a._value,b,c),d+e}function h(a){var b=Math.floor(a._value/60/60),c=Math.floor((a._value-60*b*60)/60),d=Math.round(a._value-60*b*60-60*c);return b+":"+(10>c?"0"+c:c)+":"+(10>d?"0"+d:d)}function i(a,c,d){var e,f,g,h,i=!1,j=!1,k=!1,l="",m=!1,n=!1,o=!1,p=!1,r=!1,t="",u=!1;return null===a&&(a=0),e=Math.abs(a),c.indexOf("(")>-1?(i=!0,c=c.slice(1,-1)):c.indexOf("+")>-1&&(j=!0,c=c.replace(/\+/g,"")),c.indexOf("a")>-1&&(m=c.indexOf("aK")>=0,n=c.indexOf("aM")>=0,o=c.indexOf("aB")>=0,p=c.indexOf("aT")>=0,r=m||n||o||p,c.indexOf(" a")>-1&&(l=" "),c=c.replace(new RegExp(l+"a[KMBT]?"),""),e>=Math.pow(10,12)&&!r||p?(l+=q[s.currentLanguage].abbreviations.trillion,a/=Math.pow(10,12)):e=Math.pow(10,9)&&!r||o?(l+=q[s.currentLanguage].abbreviations.billion,a/=Math.pow(10,9)):e=Math.pow(10,6)&&!r||n?(l+=q[s.currentLanguage].abbreviations.million,a/=Math.pow(10,6)):(e=Math.pow(10,3)&&!r||m)&&(l+=q[s.currentLanguage].abbreviations.thousand,a/=Math.pow(10,3))),c.indexOf("[.]")>-1&&(k=!0,c=c.replace("[.]",".")),f=a.toString().split(".")[0],g=c.split(".")[1],h=c.indexOf(","),g?(g.indexOf("[")>-1?(g=g.replace("]",""),g=g.split("["),t=b(a,g[0].length+g[1].length,d,g[1].length)):t=b(a,g.length,d),f=t.split(".")[0],t=t.indexOf(".")>-1?q[s.currentLanguage].delimiters.decimal+t.split(".")[1]:"",k&&0===Number(t.slice(1))&&(t="")):f=b(a,null,d),f.indexOf("-")>-1&&(f=f.slice(1),u=!0),h>-1&&(f=f.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+q[s.currentLanguage].delimiters.thousands)),0===c.indexOf(".")&&(f=""),(i&&u?"(":"")+(!i&&u?"-":"")+(!u&&j?"+":"")+f+t+(l?l:"")+(i&&u?")":"")}function j(a,b){var c,d,e,f,g,h,i=b,j=!1;if(b.indexOf(":")>-1)h=k(b);else if(b===s.zeroFormat||b===s.nullFormat)h=0;else{for("."!==q[s.currentLanguage].delimiters.decimal&&(b=b.replace(/\./g,"").replace(q[s.currentLanguage].delimiters.decimal,".")),c=new RegExp("[^a-zA-Z]"+q[s.currentLanguage].abbreviations.thousand+"(?:\\)|(\\"+q[s.currentLanguage].currency.symbol+")?(?:\\))?)?$"),d=new RegExp("[^a-zA-Z]"+q[s.currentLanguage].abbreviations.million+"(?:\\)|(\\"+q[s.currentLanguage].currency.symbol+")?(?:\\))?)?$"),e=new RegExp("[^a-zA-Z]"+q[s.currentLanguage].abbreviations.billion+"(?:\\)|(\\"+q[s.currentLanguage].currency.symbol+")?(?:\\))?)?$"),f=new RegExp("[^a-zA-Z]"+q[s.currentLanguage].abbreviations.trillion+"(?:\\)|(\\"+q[s.currentLanguage].currency.symbol+")?(?:\\))?)?$"),g=1;g<=t.bytes.length&&!(j=b.indexOf(t.bytes[g])>-1||b.indexOf(t.iec[g])>-1?Math.pow(1024,g):!1);g++);h=j?j:1,h*=i.match(c)?Math.pow(10,3):1,h*=i.match(d)?Math.pow(10,6):1,h*=i.match(e)?Math.pow(10,9):1,h*=i.match(f)?Math.pow(10,12):1,h*=b.indexOf("%")>-1?.01:1,h*=(b.split("-").length+Math.min(b.split("(").length-1,b.split(")").length-1))%2?1:-1,h*=Number(b.replace(/[^0-9\.]+/g,"")),h=j?Math.ceil(h):h}return a._value=h,a._value}function k(a){var b=a.split(":"),c=0;return 3===b.length?(c+=60*Number(b[0])*60,c+=60*Number(b[1]),c+=Number(b[2])):2===b.length&&(c+=60*Number(b[0]),c+=Number(b[1])),Number(c)}function l(a,b){q[a]=b}function m(a){var b=a.toString().split(".");return b.length<2?1:Math.pow(10,b[1].length)}function n(){var a=Array.prototype.slice.call(arguments);return a.reduce(function(a,b){var c=m(a),d=m(b);return c>d?c:d},-(1/0))}var o,p="1.5.5",q={},r={currentLanguage:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0"},s={currentLanguage:r.currentLanguage,zeroFormat:r.zeroFormat,nullFormat:r.nullFormat,defaultFormat:r.defaultFormat},t={bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],iec:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]};o=function(b){return b=o.isNumeral(b)?b.value():0===b||"undefined"==typeof b?0:null===b?null:Number(b)?Number(b):o.fn.unformat(b),new a(b)},o.version=p,o.isNumeral=function(b){return b instanceof a},o.language=function(a,b){if(!a)return s.currentLanguage;if(a=a.toLowerCase(),a&&!b){if(!q[a])throw new Error("Unknown language : "+a);s.currentLanguage=a}return(b||!q[a])&&l(a,b),o},o.reset=function(){for(var a in r)s[a]=r[a]},o.languageData=function(a){if(!a)return q[s.currentLanguage];if(!q[a])throw new Error("Unknown language : "+a);return q[a]},o.language("en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"},currency:{symbol:"$"}}),o.zeroFormat=function(a){s.zeroFormat="string"==typeof a?a:null},o.nullFormat=function(a){s.nullFormat="string"==typeof a?a:null},o.defaultFormat=function(a){s.defaultFormat="string"==typeof a?a:"0.0"},o.validate=function(a,b){var c,d,e,f,g,h,i,j;if("string"!=typeof a&&(a+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",a)),a=a.trim(),a.match(/^\d+$/))return!0;if(""===a)return!1;try{i=o.languageData(b)}catch(k){i=o.languageData(o.language())}return e=i.currency.symbol,g=i.abbreviations,c=i.delimiters.decimal,d="."===i.delimiters.thousands?"\\.":i.delimiters.thousands,j=a.match(/^[^\d]+/),null!==j&&(a=a.substr(1),j[0]!==e)?!1:(j=a.match(/[^\d]+$/),null!==j&&(a=a.slice(0,-1),j[0]!==g.thousand&&j[0]!==g.million&&j[0]!==g.billion&&j[0]!==g.trillion)?!1:(h=new RegExp(d+"{2}"),a.match(/[^\d.,]/g)?!1:(f=a.split(c),f.length>2?!1:f.length<2?!!f[0].match(/^\d+.*\d$/)&&!f[0].match(h):1===f[0].length?!!f[0].match(/^\d+$/)&&!f[0].match(h)&&!!f[1].match(/^\d+$/):!!f[0].match(/^\d+.*\d$/)&&!f[0].match(h)&&!!f[1].match(/^\d+$/))))},Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof a)throw new TypeError(a+" is not a function");var b,c=Object(this),d=c.length>>>0,e=0;if(2===arguments.length)b=arguments[1];else{for(;d>e&&!(e in c);)e++;if(e>=d)throw new TypeError("Reduce of empty array with no initial value");b=c[e++]}for(;d>e;e++)e in c&&(b=a(b,c[e],e,c));return b}),o.fn=a.prototype={clone:function(){return o(this)},format:function(a,b){return c(this,a?a:s.defaultFormat,void 0!==b?b:Math.round)},unformat:function(a){return"[object Number]"===Object.prototype.toString.call(a)?a:j(this,a?a:s.defaultFormat)},value:function(){return this._value},valueOf:function(){return this._value},set:function(a){return this._value=Number(a),this},add:function(a){function b(a,b,d,e){return a+c*b}var c=n.call(null,this._value,a);return this._value=[this._value,a].reduce(b,0)/c,this},subtract:function(a){function b(a,b,d,e){return a-c*b}var c=n.call(null,this._value,a);return this._value=[a].reduce(b,this._value*c)/c,this},multiply:function(a){function b(a,b,c,d){var e=n(a,b);return a*e*(b*e)/(e*e)}return this._value=[this._value,a].reduce(b,1),this},divide:function(a){function b(a,b,c,d){var e=n(a,b);return a*e/(b*e)}return this._value=[this._value,a].reduce(b),this},difference:function(a){return Math.abs(o(this._value).subtract(a).value())}},"undefined"!=typeof module&&module.exports&&(module.exports=o),"undefined"==typeof ender&&(this.numeral=o),"function"==typeof define&&define.amd&&define([],function(){return o})}).call(this);;
/*! @preserve
* numeral.js language configuration
* language : belgium-dutch (be-nl)
* author : Dieter Luypaert : https://github.com/moeriki
*/
!function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:" mln",billion:" mld",trillion:" bln"},ordinal:function(a){var b=a%100;return 0!==a&&1>=b||8===b||b>=20?"ste":"de"},currency:{symbol:"€ "}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("be-nl",a)}(),/*! @preserve
* numeral.js language configuration
* language : simplified chinese
* author : badplum : https://github.com/badplum
*/
function(){var a={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十亿",trillion:"兆"},ordinal:function(a){return"."},currency:{symbol:"¥"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("chs",a)}(),/*! @preserve
* numeral.js language configuration
* language : czech (cs)
* author : Anatoli Papirovski : https://github.com/apapirovski
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"Kč"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("cs",a)}(),/*! @preserve
* numeral.js language configuration
* language : danish denmark (dk)
* author : Michael Storgaard : https://github.com/mstorgaard
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mio",billion:"mia",trillion:"b"},ordinal:function(a){return"."},currency:{symbol:"DKK"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("da-dk",a)}(),/*! @preserve
* numeral.js language configuration
* language : German in Switzerland (de-ch)
* author : Michael Piefel : https://github.com/piefel (based on work from Marco Krage : https://github.com/sinky)
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return"."},currency:{symbol:"CHF"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("de-ch",a)}(),/*! @preserve
* numeral.js language configuration
* language : German (de) – generally useful in Germany, Austria, Luxembourg, Belgium
* author : Marco Krage : https://github.com/sinky
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return"."},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("de",a)}(),/*! @preserve
* numeral.js language configuration
* language : english united kingdom (uk)
* author : Dan Ristic : https://github.com/dristic
*/
function(){var a={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"},currency:{symbol:"£"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("en-gb",a)}(),/*!
* numeral.js language configuration
* language : english south africa (uk)
* author : Etienne Boshoff : etienne@zailab.com
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"},currency:{symbol:"R"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("en-za",a)}(),/*! @preserve
* numeral.js language configuration
* language : spanish Spain
* author : Hernan Garcia : https://github.com/hgarcia
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(a){var b=a%10;return 1===b||3===b?"er":2===b?"do":7===b||0===b?"mo":8===b?"vo":9===b?"no":"to"},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("es-ES",a)}(),/*! @preserve
* numeral.js language configuration
* language : spanish
* author : Hernan Garcia : https://github.com/hgarcia
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(a){var b=a%10;return 1===b||3===b?"er":2===b?"do":7===b||0===b?"mo":8===b?"vo":9===b?"no":"to"},currency:{symbol:"$"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("es",a)}(),/*! @preserve
* numeral.js language configuration
* language : Estonian
* author : Illimar Tambek : https://github.com/ragulka
*
* Note: in Estonian, abbreviations are always separated
* from numbers with a space
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tuh",million:" mln",billion:" mld",trillion:" trl"},ordinal:function(a){return"."},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("et",a)}(),/*! @preserve
* numeral.js language configuration
* language : Finnish
* author : Sami Saada : https://github.com/samitheberber
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(a){return"."},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("fi",a)}(),/*! @preserve
* numeral.js language configuration
* language : french (Canada) (fr-CA)
* author : Léo Renaud-Allaire : https://github.com/renaudleo
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(a){return 1===a?"er":"e"},currency:{symbol:"$"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("fr-CA",a)}(),/*! @preserve
* numeral.js language configuration
* language : french (fr-ch)
* author : Adam Draper : https://github.com/adamwdraper
*/
function(){var a={delimiters:{thousands:"'",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return 1===a?"er":"e"},currency:{symbol:"CHF"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("fr-ch",a)}(),/*! @preserve
* numeral.js language configuration
* language : french (fr)
* author : Adam Draper : https://github.com/adamwdraper
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return 1===a?"er":"e"},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("fr",a)}(),/*! @preserve
* numeral.js language configuration
* language : Hungarian (hu)
* author : Peter Bakondy : https://github.com/pbakondy
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"E",million:"M",billion:"Mrd",trillion:"T"},ordinal:function(a){return"."},currency:{symbol:" Ft"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("hu",a)}(),/*! @preserve
* numeral.js language configuration
* language : italian Italy (it)
* author : Giacomo Trombi : http://cinquepunti.it
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mila",million:"mil",billion:"b",trillion:"t"},ordinal:function(a){return"º"},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("it",a)}(),/*! @preserve
* numeral.js language configuration
* language : japanese
* author : teppeis : https://github.com/teppeis
*/
function(){var a={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十億",trillion:"兆"},ordinal:function(a){return"."},currency:{symbol:"¥"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("ja",a)}(),/*! @preserve
* numeral.js language configuration
* language : Latvian (lv)
* author : Lauris Bukšis-Haberkorns : https://github.com/Lafriks
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tūkst.",million:" milj.",billion:" mljrd.",trillion:" trilj."},ordinal:function(a){return"."},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("lv",a)}(),/*! @preserve
* numeral.js language configuration
* language : netherlands-dutch (nl-nl)
* author : Dave Clayton : https://github.com/davedx
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mln",billion:"mrd",trillion:"bln"},ordinal:function(a){var b=a%100;return 0!==a&&1>=b||8===b||b>=20?"ste":"de"},currency:{symbol:"€ "}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("nl-nl",a)}(),/*!
* numeral.js language configuration
* language : norwegian (bokmål)
* author : Ove Andersen : https://github.com/azzlack
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return"."},currency:{symbol:"kr"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&(this.numeral.language("nb-no",a),this.numeral.language("nn-no",a),this.numeral.language("no",a),this.numeral.language("nb",a),this.numeral.language("nn",a))}(),/*! @preserve
* numeral.js language configuration
* language : polish (pl)
* author : Dominik Bulaj : https://github.com/dominikbulaj
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tys.",million:"mln",billion:"mld",trillion:"bln"},ordinal:function(a){return"."},currency:{symbol:"PLN"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("pl",a)}(),/*! @preserve
* numeral.js language configuration
* language : portuguese brazil (pt-br)
* author : Ramiro Varandas Jr : https://github.com/ramirovjr
*/
function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mil",million:"milhões",billion:"b",trillion:"t"},ordinal:function(a){return"º"},currency:{symbol:"R$"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("pt-br",a)}(),/*! @preserve
* numeral.js language configuration
* language : portuguese (pt-pt)
* author : Diogo Resende : https://github.com/dresende
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(a){return"º"},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("pt-pt",a)}(),function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"₴"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("ru-UA",a)}(),/*! @preserve
* numeral.js language configuration
* language : russian (ru)
* author : Anatoli Papirovski : https://github.com/apapirovski
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн.",billion:"млрд.",trillion:"трлн."},ordinal:function(){return"."},currency:{symbol:"руб."}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("ru",a)}(),/*! @preserve
* numeral.js language configuration
* language : slovak (sk)
* author : Ahmed Al Hafoudh : http://www.freevision.sk
*/
function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"€"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("sk",a)}(),/*! @preserve
* numeral.js language configuration
* language : thai (th)
* author : Sathit Jittanupat : https://github.com/jojosati
*/
function(){var a={delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"พัน",million:"ล้าน",billion:"พันล้าน",trillion:"ล้านล้าน"},ordinal:function(a){return"."},currency:{symbol:"฿"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("th",a)}(),/*! @preserve
* numeral.js language configuration
* language : turkish (tr)
* author : Ecmel Ercan : https://github.com/ecmel, Erhan Gundogan : https://github.com/erhangundogan, Burak Yiğit Kaya: https://github.com/BYK
*/
function(){var a={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},b={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"bin",million:"milyon",billion:"milyar",trillion:"trilyon"},ordinal:function(b){if(0===b)return"'ıncı";var c=b%10,d=b%100-c,e=b>=100?100:null;return a[c]||a[d]||a[e]},currency:{symbol:"₺"}};"undefined"!=typeof module&&module.exports&&(module.exports=b),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("tr",b)}(),function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тис.",million:"млн",billion:"млрд",trillion:"блн"},ordinal:function(){return""},currency:{symbol:"₴"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("uk-UA",a)}();;
/*! @preserve
* numeral.js language configuration
* language : portuguese brazil (pt-br)
* author : Ramiro Varandas Jr : https://github.com/ramirovjr
*/
!function(){var a={delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mil",million:"milhões",billion:"b",trillion:"t"},ordinal:function(a){return"º"},currency:{symbol:"R$"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("pt-br",a)}();;
// Rivets.js + Sightglass.js
// version: 0.8.1
// author: Michael Richards
// license: MIT
(function(){function t(t,i,s,h){return new e(t,i,s,h)}function e(t,e,s,h){this.options=h||{},this.options.adapters=this.options.adapters||{},this.obj=t,this.keypath=e,this.callback=s,this.objectPath=[],this.parse(),i(this.target=this.realize())&&this.set(!0,this.key,this.target,this.callback)}function i(t){return"object"==typeof t&&null!==t}function s(t){throw new Error("[sightglass] "+t)}t.adapters={},e.tokenize=function(t,e,i){var s,h,a=[],o={i:i,path:""};for(s=0;se;e++)if(e in this&&this[e]===t)return e;return-1};t={options:["prefix","templateDelimiters","rootInterface","preloadData","handler"],extensions:["binders","formatters","components","adapters"],"public":{binders:{},components:{},formatters:{},adapters:{},prefix:"rv",templateDelimiters:["{","}"],rootInterface:".",preloadData:!0,handler:function(t,e,i){return this.call(t,e,i.view.models)},configure:function(e){var i,n,r,s;null==e&&(e={});for(r in e)if(s=e[r],"binders"===r||"components"===r||"formatters"===r||"adapters"===r)for(n in s)i=s[n],t[r][n]=i;else t["public"][r]=s},bind:function(e,i,n){var r;return null==i&&(i={}),null==n&&(n={}),r=new t.View(e,i,n),r.bind(),r},init:function(e,i,n){var r,s;return null==n&&(n={}),null==i&&(i=document.createElement("div")),e=t["public"].components[e],i.innerHTML=e.template.call(this,i),r=e.initialize.call(this,i,n),s=new t.View(i,r),s.bind(),s}}},window.jQuery||window.$?(n="on"in jQuery.prototype?["on","off"]:["bind","unbind"],e=n[0],i=n[1],t.Util={bindEvent:function(t,i,n){return jQuery(t)[e](i,n)},unbindEvent:function(t,e,n){return jQuery(t)[i](e,n)},getInputValue:function(t){var e;return e=jQuery(t),"checkbox"===e.attr("type")?e.is(":checked"):e.val()}}):t.Util={bindEvent:function(){return"addEventListener"in window?function(t,e,i){return t.addEventListener(e,i,!1)}:function(t,e,i){return t.attachEvent("on"+e,i)}}(),unbindEvent:function(){return"removeEventListener"in window?function(t,e,i){return t.removeEventListener(e,i,!1)}:function(t,e,i){return t.detachEvent("on"+e,i)}}(),getInputValue:function(t){var e,i,n,r;if("checkbox"===t.type)return t.checked;if("select-multiple"===t.type){for(r=[],i=0,n=t.length;n>i;i++)e=t[i],e.selected&&r.push(e.value);return r}return t.value}},t.TypeParser=function(){function t(){}return t.types={primitive:0,keypath:1},t.parse=function(t){return/^'.*'$|^".*"$/.test(t)?{type:this.types.primitive,value:t.slice(1,-1)}:"true"===t?{type:this.types.primitive,value:!0}:"false"===t?{type:this.types.primitive,value:!1}:"null"===t?{type:this.types.primitive,value:null}:"undefined"===t?{type:this.types.primitive,value:void 0}:isNaN(Number(t))===!1?{type:this.types.primitive,value:Number(t)}:{type:this.types.keypath,value:t}},t}(),t.TextTemplateParser=function(){function t(){}return t.types={text:0,binding:1},t.parse=function(t,e){var i,n,r,s,o,u,l;for(u=[],s=t.length,i=0,n=0;s>n;){if(i=t.indexOf(e[0],n),0>i){u.push({type:this.types.text,value:t.slice(n)});break}if(i>0&&i>n&&u.push({type:this.types.text,value:t.slice(n,i)}),n=i+e[0].length,i=t.indexOf(e[1],n),0>i){o=t.slice(n-e[1].length),r=u[u.length-1],(null!=r?r.type:void 0)===this.types.text?r.value+=o:u.push({type:this.types.text,value:o});break}l=t.slice(n,i).trim(),u.push({type:this.types.binding,value:l}),n=i+e[1].length}return u},t}(),t.View=function(){function e(e,i,n){var s,o,u,l,h,a,p,d,c,f,b,v,y;for(this.els=e,this.models=i,null==n&&(n={}),this.update=r(this.update,this),this.publish=r(this.publish,this),this.sync=r(this.sync,this),this.unbind=r(this.unbind,this),this.bind=r(this.bind,this),this.select=r(this.select,this),this.traverse=r(this.traverse,this),this.build=r(this.build,this),this.buildBinding=r(this.buildBinding,this),this.bindingRegExp=r(this.bindingRegExp,this),this.options=r(this.options,this),this.els.jquery||this.els instanceof Array||(this.els=[this.els]),c=t.extensions,h=0,p=c.length;p>h;h++){if(o=c[h],this[o]={},n[o]){f=n[o];for(s in f)u=f[s],this[o][s]=u}b=t["public"][o];for(s in b)u=b[s],null==(l=this[o])[s]&&(l[s]=u)}for(v=t.options,a=0,d=v.length;d>a;a++)o=v[a],this[o]=null!=(y=n[o])?y:t["public"][o];this.build()}return e.prototype.options=function(){var e,i,n,r,s;for(i={},s=t.extensions.concat(t.options),n=0,r=s.length;r>n;n++)e=s[n],i[e]=this[e];return i},e.prototype.bindingRegExp=function(){return new RegExp("^"+this.prefix+"-")},e.prototype.buildBinding=function(e,i,n,r){var s,o,u,l,h,a,p;return h={},p=function(){var t,e,i,n;for(i=r.split("|"),n=[],t=0,e=i.length;e>t;t++)a=i[t],n.push(a.trim());return n}(),s=function(){var t,e,i,n;for(i=p.shift().split("<"),n=[],t=0,e=i.length;e>t;t++)o=i[t],n.push(o.trim());return n}(),l=s.shift(),h.formatters=p,(u=s.shift())&&(h.dependencies=u.split(/\s+/)),this.bindings.push(new t[e](this,i,n,l,h))},e.prototype.build=function(){var e,i,n,r,s;for(this.bindings=[],i=function(e){return function(n){var r,s,o,u,l,h,a,p,d,c,f,b,v,y;if(3===n.nodeType){if(l=t.TextTemplateParser,(o=e.templateDelimiters)&&(p=l.parse(n.data,o)).length&&(1!==p.length||p[0].type!==l.types.text)){for(d=0,f=p.length;f>d;d++)a=p[d],h=document.createTextNode(a.value),n.parentNode.insertBefore(h,n),1===a.type&&e.buildBinding("TextBinding",h,null,a.value);n.parentNode.removeChild(n)}}else 1===n.nodeType&&(r=e.traverse(n));if(!r){for(v=function(){var t,e,i,r;for(i=n.childNodes,r=[],t=0,e=i.length;e>t;t++)u=i[t],r.push(u);return r}(),y=[],c=0,b=v.length;b>c;c++)s=v[c],y.push(i(s));return y}}}(this),s=this.els,n=0,r=s.length;r>n;n++)e=s[n],i(e);this.bindings.sort(function(t,e){var i,n;return((null!=(i=e.binder)?i.priority:void 0)||0)-((null!=(n=t.binder)?n.priority:void 0)||0)})},e.prototype.traverse=function(e){var i,n,r,s,o,u,l,h,a,p,d,c,f,b,v,y;for(s=this.bindingRegExp(),o="SCRIPT"===e.nodeName||"STYLE"===e.nodeName,b=e.attributes,p=0,c=b.length;c>p;p++)if(i=b[p],s.test(i.name)){if(h=i.name.replace(s,""),!(r=this.binders[h])){v=this.binders;for(u in v)a=v[u],"*"!==u&&-1!==u.indexOf("*")&&(l=new RegExp("^"+u.replace(/\*/g,".+")+"$"),l.test(h)&&(r=a))}r||(r=this.binders["*"]),r.block&&(o=!0,n=[i])}for(y=n||e.attributes,d=0,f=y.length;f>d;d++)i=y[d],s.test(i.name)&&(h=i.name.replace(s,""),this.buildBinding("Binding",e,h,i.value));return o||(h=e.nodeName.toLowerCase(),this.components[h]&&!e._bound&&(this.bindings.push(new t.ComponentBinding(this,e,h)),o=!0)),o},e.prototype.select=function(t){var e,i,n,r,s;for(r=this.bindings,s=[],i=0,n=r.length;n>i;i++)e=r[i],t(e)&&s.push(e);return s},e.prototype.bind=function(){var t,e,i,n,r;for(n=this.bindings,r=[],e=0,i=n.length;i>e;e++)t=n[e],r.push(t.bind());return r},e.prototype.unbind=function(){var t,e,i,n,r;for(n=this.bindings,r=[],e=0,i=n.length;i>e;e++)t=n[e],r.push(t.unbind());return r},e.prototype.sync=function(){var t,e,i,n,r;for(n=this.bindings,r=[],e=0,i=n.length;i>e;e++)t=n[e],r.push("function"==typeof t.sync?t.sync():void 0);return r},e.prototype.publish=function(){var t,e,i,n,r;for(n=this.select(function(t){var e;return null!=(e=t.binder)?e.publishes:void 0}),r=[],e=0,i=n.length;i>e;e++)t=n[e],r.push(t.publish());return r},e.prototype.update=function(t){var e,i,n,r,s,o,u;null==t&&(t={});for(i in t)n=t[i],this.models[i]=n;for(o=this.bindings,u=[],r=0,s=o.length;s>r;r++)e=o[r],u.push("function"==typeof e.update?e.update(t):void 0);return u},e}(),t.Binding=function(){function e(t,e,i,n,s){this.view=t,this.el=e,this.type=i,this.keypath=n,this.options=null!=s?s:{},this.getValue=r(this.getValue,this),this.update=r(this.update,this),this.unbind=r(this.unbind,this),this.bind=r(this.bind,this),this.publish=r(this.publish,this),this.sync=r(this.sync,this),this.set=r(this.set,this),this.eventHandler=r(this.eventHandler,this),this.formattedValue=r(this.formattedValue,this),this.parseTarget=r(this.parseTarget,this),this.observe=r(this.observe,this),this.setBinder=r(this.setBinder,this),this.formatters=this.options.formatters||[],this.dependencies=[],this.formatterObservers={},this.model=void 0,this.setBinder()}return e.prototype.setBinder=function(){var t,e,i,n;if(!(this.binder=this.view.binders[this.type])){n=this.view.binders;for(t in n)i=n[t],"*"!==t&&-1!==t.indexOf("*")&&(e=new RegExp("^"+t.replace(/\*/g,".+")+"$"),e.test(this.type)&&(this.binder=i,this.args=new RegExp("^"+t.replace(/\*/g,"(.+)")+"$").exec(this.type),this.args.shift()))}return this.binder||(this.binder=this.view.binders["*"]),this.binder instanceof Function?this.binder={routine:this.binder}:void 0},e.prototype.observe=function(e,i,n){return t.sightglass(e,i,n,{root:this.view.rootInterface,adapters:this.view.adapters})},e.prototype.parseTarget=function(){var e;return e=t.TypeParser.parse(this.keypath),0===e.type?this.value=e.value:(this.observer=this.observe(this.view.models,this.keypath,this.sync),this.model=this.observer.target)},e.prototype.formattedValue=function(e){var i,n,r,o,u,l,h,a,p,d,c,f,b,v;for(v=this.formatters,o=d=0,f=v.length;f>d;o=++d){for(u=v[o],r=u.match(/[^\s']+|'([^']|'[^\s])*'|"([^"]|"[^\s])*"/g),l=r.shift(),u=this.view.formatters[l],r=function(){var e,i,s;for(s=[],e=0,i=r.length;i>e;e++)n=r[e],s.push(t.TypeParser.parse(n));return s}(),a=[],i=c=0,b=r.length;b>c;i=++c)n=r[i],a.push(0===n.type?n.value:((p=this.formatterObservers)[o]||(p[o]={}),(h=this.formatterObservers[o][i])?void 0:(h=this.observe(this.view.models,n.value,this.sync),this.formatterObservers[o][i]=h),h.value()));(null!=u?u.read:void 0)instanceof Function?e=u.read.apply(u,[e].concat(s.call(a))):u instanceof Function&&(e=u.apply(null,[e].concat(s.call(a))))}return e},e.prototype.eventHandler=function(t){var e,i;return i=(e=this).view.handler,function(n){return i.call(t,this,n,e)}},e.prototype.set=function(t){var e;return t=t instanceof Function&&!this.binder["function"]?this.formattedValue(t.call(this.model)):this.formattedValue(t),null!=(e=this.binder.routine)?e.call(this,this.el,t):void 0},e.prototype.sync=function(){var t,e;return this.set(function(){var i,n,r,s,o,u,l;if(this.observer){if(this.model!==this.observer.target){for(o=this.dependencies,i=0,r=o.length;r>i;i++)e=o[i],e.unobserve();if(this.dependencies=[],null!=(this.model=this.observer.target)&&(null!=(u=this.options.dependencies)?u.length:void 0))for(l=this.options.dependencies,n=0,s=l.length;s>n;n++)t=l[n],e=this.observe(this.model,t,this.sync),this.dependencies.push(e)}return this.observer.value()}return this.value}.call(this))},e.prototype.publish=function(){var t,e,i,n,r,o,u,l,h;if(this.observer){for(n=this.getValue(this.el),u=this.formatters.slice(0).reverse(),r=0,o=u.length;o>r;r++)e=u[r],t=e.split(/\s+/),i=t.shift(),(null!=(l=this.view.formatters[i])?l.publish:void 0)&&(n=(h=this.view.formatters[i]).publish.apply(h,[n].concat(s.call(t))));return this.observer.setValue(n)}},e.prototype.bind=function(){var t,e,i,n,r,s,o;if(this.parseTarget(),null!=(r=this.binder.bind)&&r.call(this,this.el),null!=this.model&&(null!=(s=this.options.dependencies)?s.length:void 0))for(o=this.options.dependencies,i=0,n=o.length;n>i;i++)t=o[i],e=this.observe(this.model,t,this.sync),this.dependencies.push(e);return this.view.preloadData?this.sync():void 0},e.prototype.unbind=function(){var t,e,i,n,r,s,o,u,l,h;for(null!=(o=this.binder.unbind)&&o.call(this,this.el),null!=(u=this.observer)&&u.unobserve(),l=this.dependencies,r=0,s=l.length;s>r;r++)n=l[r],n.unobserve();this.dependencies=[],h=this.formatterObservers;for(i in h){e=h[i];for(t in e)n=e[t],n.unobserve()}return this.formatterObservers={}},e.prototype.update=function(t){var e,i;return null==t&&(t={}),this.model=null!=(e=this.observer)?e.target:void 0,null!=(i=this.binder.update)?i.call(this,t):void 0},e.prototype.getValue=function(e){return this.binder&&null!=this.binder.getValue?this.binder.getValue.call(this,e):t.Util.getInputValue(e)},e}(),t.ComponentBinding=function(e){function i(t,e,i){var n,s,o,u,h,a,p;for(this.view=t,this.el=e,this.type=i,this.unbind=r(this.unbind,this),this.bind=r(this.bind,this),this.locals=r(this.locals,this),this.component=this.view.components[this.type],this["static"]={},this.observers={},this.upstreamObservers={},s=t.bindingRegExp(),a=this.el.attributes||[],u=0,h=a.length;h>u;u++)n=a[u],s.test(n.name)||(o=this.camelCase(n.name),l.call(null!=(p=this.component["static"])?p:[],o)>=0?this["static"][o]=n.value:this.observers[o]=n.value)}return u(i,e),i.prototype.sync=function(){},i.prototype.update=function(){},i.prototype.publish=function(){},i.prototype.locals=function(){var t,e,i,n,r,s;i={},r=this["static"];for(t in r)n=r[t],i[t]=n;s=this.observers;for(t in s)e=s[t],i[t]=e.value();return i},i.prototype.camelCase=function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},i.prototype.bind=function(){var e,i,n,r,s,o,u,l,h,a,p,d,c,f,b,v,y,g,m,w,k;if(!this.bound){f=this.observers;for(i in f)n=f[i],this.observers[i]=this.observe(this.view.models,n,function(t){return function(e){return function(){return t.componentView.models[e]=t.observers[e].value()}}}(this).call(this,i));this.bound=!0}if(null!=this.componentView)return this.componentView.bind();for(this.el.innerHTML=this.component.template.call(this),u=this.component.initialize.call(this,this.el,this.locals()),this.el._bound=!0,o={},b=t.extensions,a=0,d=b.length;d>a;a++){if(s=b[a],o[s]={},this.component[s]){v=this.component[s];for(e in v)l=v[e],o[s][e]=l}y=this.view[s];for(e in y)l=y[e],null==(h=o[s])[e]&&(h[e]=l)}for(g=t.options,p=0,c=g.length;c>p;p++)s=g[p],o[s]=null!=(m=this.component[s])?m:this.view[s];this.componentView=new t.View(this.el,u,o),this.componentView.bind(),w=this.observers,k=[];for(i in w)r=w[i],k.push(this.upstreamObservers[i]=this.observe(this.componentView.models,i,function(t){return function(e,i){return function(){return i.setValue(t.componentView.models[e])}}}(this).call(this,i,r)));return k},i.prototype.unbind=function(){var t,e,i,n,r;i=this.upstreamObservers;for(t in i)e=i[t],e.unobserve();n=this.observers;for(t in n)e=n[t],e.unobserve();return null!=(r=this.componentView)?r.unbind.call(this):void 0},i}(t.Binding),t.TextBinding=function(t){function e(t,e,i,n,s){this.view=t,this.el=e,this.type=i,this.keypath=n,this.options=null!=s?s:{},this.sync=r(this.sync,this),this.formatters=this.options.formatters||[],this.dependencies=[],this.formatterObservers={}}return u(e,t),e.prototype.binder={routine:function(t,e){return t.data=null!=e?e:""}},e.prototype.sync=function(){return e.__super__.sync.apply(this,arguments)},e}(t.Binding),t["public"].binders.text=function(t,e){return null!=t.textContent?t.textContent=null!=e?e:"":t.innerText=null!=e?e:""},t["public"].binders.html=function(t,e){return t.innerHTML=null!=e?e:""},t["public"].binders.show=function(t,e){return t.style.display=e?"":"none"},t["public"].binders.hide=function(t,e){return t.style.display=e?"none":""},t["public"].binders.enabled=function(t,e){return t.disabled=!e},t["public"].binders.disabled=function(t,e){return t.disabled=!!e},t["public"].binders.checked={publishes:!0,priority:2e3,bind:function(e){return t.Util.bindEvent(e,"change",this.publish)},unbind:function(e){return t.Util.unbindEvent(e,"change",this.publish)},routine:function(t,e){var i;return t.checked="radio"===t.type?(null!=(i=t.value)?i.toString():void 0)===(null!=e?e.toString():void 0):!!e}},t["public"].binders.unchecked={publishes:!0,priority:2e3,bind:function(e){return t.Util.bindEvent(e,"change",this.publish)},unbind:function(e){return t.Util.unbindEvent(e,"change",this.publish)},routine:function(t,e){var i;return t.checked="radio"===t.type?(null!=(i=t.value)?i.toString():void 0)!==(null!=e?e.toString():void 0):!e}},t["public"].binders.value={publishes:!0,priority:3e3,bind:function(e){return"INPUT"!==e.tagName||"radio"!==e.type?(this.event="SELECT"===e.tagName?"change":"input",t.Util.bindEvent(e,this.event,this.publish)):void 0},unbind:function(e){return"INPUT"!==e.tagName||"radio"!==e.type?t.Util.unbindEvent(e,this.event,this.publish):void 0},routine:function(t,e){var i,n,r,s,o,u,h;if("INPUT"===t.tagName&&"radio"===t.type)return t.setAttribute("value",e);if(null!=window.jQuery){if(t=jQuery(t),(null!=e?e.toString():void 0)!==(null!=(s=t.val())?s.toString():void 0))return t.val(null!=e?e:"")}else if("select-multiple"===t.type){if(null!=e){for(h=[],n=0,r=t.length;r>n;n++)i=t[n],h.push(i.selected=(o=i.value,l.call(e,o)>=0));return h}}else if((null!=e?e.toString():void 0)!==(null!=(u=t.value)?u.toString():void 0))return t.value=null!=e?e:""}},t["public"].binders["if"]={block:!0,priority:4e3,bind:function(t){var e,i;return null==this.marker?(e=[this.view.prefix,this.type].join("-").replace("--","-"),i=t.getAttribute(e),this.marker=document.createComment(" rivets: "+this.type+" "+i+" "),this.bound=!1,t.removeAttribute(e),t.parentNode.insertBefore(this.marker,t),t.parentNode.removeChild(t)):void 0},unbind:function(){var t;return null!=(t=this.nested)?t.unbind():void 0},routine:function(e,i){var n,r,s,o;if(!!i==!this.bound){if(i){s={},o=this.view.models;for(n in o)r=o[n],s[n]=r;return(this.nested||(this.nested=new t.View(e,s,this.view.options()))).bind(),this.marker.parentNode.insertBefore(e,this.marker.nextSibling),this.bound=!0}return e.parentNode.removeChild(e),this.nested.unbind(),this.bound=!1}},update:function(t){var e;return null!=(e=this.nested)?e.update(t):void 0}},t["public"].binders.unless={block:!0,priority:4e3,bind:function(e){return t["public"].binders["if"].bind.call(this,e)},unbind:function(){return t["public"].binders["if"].unbind.call(this)},routine:function(e,i){return t["public"].binders["if"].routine.call(this,e,!i)},update:function(e){return t["public"].binders["if"].update.call(this,e)}},t["public"].binders["on-*"]={"function":!0,priority:1e3,unbind:function(e){return this.handler?t.Util.unbindEvent(e,this.args[0],this.handler):void 0},routine:function(e,i){return this.handler&&t.Util.unbindEvent(e,this.args[0],this.handler),t.Util.bindEvent(e,this.args[0],this.handler=this.eventHandler(i))}},t["public"].binders["each-*"]={block:!0,priority:4e3,bind:function(t){var e,i,n,r,s;if(null==this.marker)e=[this.view.prefix,this.type].join("-").replace("--","-"),this.marker=document.createComment(" rivets: "+this.type+" "),this.iterated=[],t.removeAttribute(e),t.parentNode.insertBefore(this.marker,t),t.parentNode.removeChild(t);else for(s=this.iterated,n=0,r=s.length;r>n;n++)i=s[n],i.bind()},unbind:function(){var t,e,i,n,r;if(null!=this.iterated){for(n=this.iterated,r=[],e=0,i=n.length;i>e;e++)t=n[e],r.push(t.unbind());return r}},routine:function(e,i){var n,r,s,o,u,l,h,a,p,d,c,f,b,v,y,g,m,w,k,x,N;if(h=this.args[0],i=i||[],this.iterated.length>i.length)for(w=Array(this.iterated.length-i.length),f=0,y=w.length;y>f;f++)s=w[f],c=this.iterated.pop(),c.unbind(),this.marker.parentNode.removeChild(c.els[0]);for(o=b=0,g=i.length;g>b;o=++b)if(l=i[o],r={index:o},r[h]=l,null==this.iterated[o]){k=this.view.models;for(u in k)l=k[u],null==r[u]&&(r[u]=l);p=this.iterated.length?this.iterated[this.iterated.length-1].els[0]:this.marker,a=this.view.options(),a.preloadData=!0,d=e.cloneNode(!0),c=new t.View(d,r,a),c.bind(),this.iterated.push(c),this.marker.parentNode.insertBefore(d,p.nextSibling)}else this.iterated[o].models[h]!==l&&this.iterated[o].update(r);if("OPTION"===e.nodeName){for(x=this.view.bindings,N=[],v=0,m=x.length;m>v;v++)n=x[v],n.el===this.marker.parentNode&&"value"===n.type?N.push(n.sync()):N.push(void 0);return N}},update:function(t){var e,i,n,r,s,o,u,l;e={};for(i in t)n=t[i],i!==this.args[0]&&(e[i]=n);for(u=this.iterated,l=[],s=0,o=u.length;o>s;s++)r=u[s],l.push(r.update(e));return l}},t["public"].binders["class-*"]=function(t,e){var i;return i=" "+t.className+" ",!e==(-1!==i.indexOf(" "+this.args[0]+" "))?t.className=e?""+t.className+" "+this.args[0]:i.replace(" "+this.args[0]+" "," ").trim():void 0},t["public"].binders["*"]=function(t,e){return null!=e?t.setAttribute(this.type,e):t.removeAttribute(this.type)},t["public"].adapters["."]={id:"_rv",counter:0,weakmap:{},weakReference:function(t){var e,i,n;return t.hasOwnProperty(this.id)||(e=this.counter++,Object.defineProperty(t,this.id,{value:e})),(i=this.weakmap)[n=t[this.id]]||(i[n]={callbacks:{}})},cleanupWeakReference:function(t,e){return Object.keys(t.callbacks).length||t.pointers&&Object.keys(t.pointers).length?void 0:delete this.weakmap[e]},stubFunction:function(t,e){var i,n,r;return n=t[e],i=this.weakReference(t),r=this.weakmap,t[e]=function(){var e,s,o,u,l,h,a,p,d,c;u=n.apply(t,arguments),a=i.pointers;for(o in a)for(s=a[o],c=null!=(p=null!=(d=r[o])?d.callbacks[s]:void 0)?p:[],l=0,h=c.length;h>l;l++)e=c[l],e();return u}},observeMutations:function(t,e,i){var n,r,s,o,u,h;if(Array.isArray(t)){if(s=this.weakReference(t),null==s.pointers)for(s.pointers={},r=["push","pop","shift","unshift","sort","reverse","splice"],u=0,h=r.length;h>u;u++)n=r[u],this.stubFunction(t,n);if(null==(o=s.pointers)[e]&&(o[e]=[]),l.call(s.pointers[e],i)<0)return s.pointers[e].push(i)}},unobserveMutations:function(t,e,i){var n,r,s;return Array.isArray(t)&&null!=t[this.id]&&(r=this.weakmap[t[this.id]])&&(s=r.pointers[e])?((n=s.indexOf(i))>=0&&s.splice(n,1),s.length||delete r.pointers[e],this.cleanupWeakReference(r,t[this.id])):void 0},observe:function(t,e,i){var n,r,s;return n=this.weakReference(t).callbacks,null==n[e]&&(n[e]=[],r=Object.getOwnPropertyDescriptor(t,e),(null!=r?r.get:void 0)||(null!=r?r.set:void 0)||(s=t[e],Object.defineProperty(t,e,{enumerable:!0,get:function(){return s},set:function(r){return function(o){var u,h,a,p;if(o!==s&&(r.unobserveMutations(s,t[r.id],e),s=o,u=r.weakmap[t[r.id]])){if(n=u.callbacks,n[e])for(p=n[e].slice(),h=0,a=p.length;a>h;h++)i=p[h],l.call(n[e],i)>=0&&i();return r.observeMutations(o,t[r.id],e)}}}(this)}))),l.call(n[e],i)<0&&n[e].push(i),this.observeMutations(t[e],t[this.id],e)},unobserve:function(t,e,i){var n,r,s;return(s=this.weakmap[t[this.id]])&&(n=s.callbacks[e])?((r=n.indexOf(i))>=0&&(n.splice(r,1),n.length||delete s.callbacks[e]),this.unobserveMutations(t[e],t[this.id],e),this.cleanupWeakReference(s,t[this.id])):void 0},get:function(t,e){return t[e]},set:function(t,e,i){return t[e]=i}},t.factory=function(e){return t.sightglass=e,t["public"]._=t,t["public"]},"object"==typeof("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=t.factory(require("sightglass")):"function"==typeof define&&define.amd?define(["sightglass"],function(e){return this.rivets=t.factory(e)}):this.rivets=t.factory(sightglass)}).call(this);;
numeral.language('pt-br');
// formata dinheiro (usa js de languages para tratar pt-BR)
rivets.formatters.money = function(value){
return numeral(value).format('$ 0,0.00');
};
rivets.formatters.absoluteMoney = function(value){
value = Math.abs(value);
return numeral(value).format('$ 0,0.00');
};
// faz decode de html entities
rivets.formatters.html = function(value){
return value ? he.decode(value) : '';
};
// filtros para tratar if's de desconto por nome
rivets.formatters.if_desconto_cupom = function(value) {
return value == "desconto_cupom";
}
rivets.formatters.if_desconto_atacado = function(value) {
return value == "desconto_atacado";
}
rivets.formatters.if_desconto_cliente = function(value) {
return value == "desconto_cliente";
}
rivets.formatters.if_desconto_vr_compra = function(value) {
return value == "desconto_vr_compra";
}
rivets.formatters.desconto_vr_compra = function(value) {
return value.flg_tipo_desconto == 1 ? numeral(value.vr_desconto).format('$ 0,0.00') : value.vr_desconto + '%';
}
rivets.formatters.link = function(link, param) {
param = param != undefined ? param : '';
return BASE_URL + link + param;
}
rivets.formatters.imgLink = function(link, ext, param) {
param = param != undefined ? param : '';
return BASE_URL + link + param + ext;
}
rivets.formatters.endereco_apelido = function(apelido) {
return apelido ? apelido : 'Principal';
}
rivets.formatters.cep = function(cep) {
if(cep) {
cep = cep.replace('-', '');
var aux = cep.slice(0,5);
var aux2 = cep.slice(5);
return aux + '-' + aux2;
}
else {
return '00000-000';
}
}
rivets.formatters.concat = function(value, string) {
return value + string;
}
rivets.formatters.boolean = function(value) {
return !value == undefined;
}
rivets.formatters.prepend = function(value, prepend) {
return prepend + value;
}
rivets.formatters.compare = function(value, value2) {
return value == value2;
}
rivets.formatters.notEqual = function(value, value2) {
return value != value2;
}
rivets.formatters.lessOrEqual = function(value, value2) {
return numeral(value) <= numeral(value2);
}
rivets.formatters.greaterOrEqual = function(value, value2) {
return numeral(value) >= numeral(value2);
}
rivets.formatters.greater = function(value, value2) {
return value > value2;
}
rivets.formatters.lesser = function(value, value2) {
return value < value2;
}
rivets.formatters.empty = function(value) {
if(value == null || value.length == 0) {
return true;
}
else {
return false;
}
}
rivets.formatters.notempty = function(value) {
if(value == null || value.length == 0) {
return false;
}
else {
return true;
}
}
rivets.formatters.uppercase = function(str) {
return typeof str == "string" ? str.toUpperCase() : '';
}
rivets.formatters.teste = function(a, b, c, d) {
a = a + b;
b = c + d;
return a == b;
};
function aplicaEfeitoSurgir(elemento,efeitoElemento)
{
$(elemento).each(function(){
var elementTopDistance = $(this).offset().top;
var scrollTopoDistance = $(window).scrollTop();
var alturaTela = $(window).height();
/*var alturaElemento = $(this).height();*/
var valorBase = scrollTopoDistance + alturaTela;
if ( elementTopDistance < valorBase - 50) {
$(this).addClass(efeitoElemento);
}
});
}
// Função que verifica se a altura dos conteúdos da loja é menor que a altura da tela
// Caso positivo, aumenta a altura do conteúdo central para que o rodapé fique na base da tela
function ajustaAlturaConteudoMeio()
{
var alturaTela = $(window).height();
var alturaLoja = $('body').height();
if( alturaLoja < alturaTela )
{
$('body, html').css('height', '100%');
var alturaTopo = $('header').height();
var alturaRodape = $('footer').height();
var alturaAplicar = alturaTopo + alturaRodape;
var alturaFinal = 'calc(100% - '+ alturaAplicar +'px)';
$('header').next('section').css('min-height', alturaFinal);
}
}
// Função responsável por chamar novamente a função de carregamento do magnific popup
function rodaNovamente()
{
loaderMagnificPopup();
}
// Função responsável por verificar se o iframe do Magnific popup já foi carregado
// Para isso, a função verifica, de 1 em 1 segundo, se já existe alguma div dentro do body do iframe
// Caso negativo: Chama a função rodaNovamente() para repetir o processo
// Caso positivo, remove o processando e exibe o modal
function loaderMagnificPopup()
{
var conteudoIframe = $(".mfp-iframe").contents().find("body").find("div");
if (conteudoIframe.length == 0) {
setTimeout(function(){
rodaNovamente();
}, 1000);
}
else
{
$('.mfp-content').css('opacity','1');
setTimeout(function(){
processandoDialog.remove();
},300);
}
};
function verificaDispositivoIos()
{
if( BASE_URL == window.location )
{
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
$('body').addClass('dispositivoIos');
}
}
else
{
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
$('body').addClass('corrigeLogoIos');
}
}
}
//Função responsável por reiniciar o Hcaptcha
//Função utilizada principalmente para erros de formulário
function resetHcaptcha(hcaptcha_widget_id)
{
hcaptcha.reset(hcaptcha_widget_id);
}
//Função responsável por rolar suavemente a tela para imediatamente após o topo
var $htmlBody = $('html, body');
var $conteudoHome = $('.conteudoHome');
function rolaTelaConteudo(tempo){
//Verifica se existe ao menos um elemento Imagem & texto ou banner com botão na seção do topo
//Caso positivo, aumenta o tempo para a rolagem para garantir o funcionamento correto do scroll
//Tal verificação é necessária, pois os elementos de banner podem ter uma imagem pequena em altura e, no momento de detectar as alturas para o cálculo do scroll...
//...a imagem pode ainda não ter sido carregada. Isso faz com que os cálculos fiquem errados
var header = document.querySelector('header');
var alteraTempoRolagem = false;
var existeImagemTexto = header.querySelector('div.estiloImagem1') !== null;
var existeBannerComBotao = header.querySelector('div.elementoBannerComBotao') !== null;
if( existeImagemTexto || existeBannerComBotao ) {
alteraTempoRolagem = true;
}
//Caso possua algum dos elementos
if( alteraTempoRolagem ) {
tempo = 2000;
setTimeout(function(){
var alturaHeader = $('header').height();
var larguraTela = $(window).width();
var valorLimite = larguraTela > 768 ?400:250;
if( alturaHeader > valorLimite ) {
$htmlBody.animate({
scrollTop: $conteudoHome.offset().top - 50
}, 500);
}
},tempo);
} else {
var alturaHeader = $('header').height();
var larguraTela = $(window).width();
var valorLimite = larguraTela > 768 ?400:250;
if( alturaHeader > valorLimite ) {
setTimeout(function(){
$htmlBody.animate({
scrollTop: $conteudoHome.offset().top - 50
}, 500);
},tempo);
}
}
}
//Função responsável por rodar os vídeos da listagem de produtos
function playVideoWhenVisible(entries, observer) {
entries.forEach(entry => {
if (entry.isIntersecting) {
var iframe = entry.target;
var src = iframe.dataset.src;
iframe.src = src;
observer.unobserve(iframe);
}
});
}
//Funções responsáveis pela barra de progresso do frete grátis na tela de carrinho
function seta_progresso_frete_gratis(progress)
{
const progressBar = document.getElementById('itemBarraProgressoFreteGratis');
const boxProgressBar = document.getElementById('itemBarraProgressoFreteGratis');
progressBar.style.width = `${progress}%`;
//const color = retorna_core_progresso(progress);
//progressBar.style.background = color;
if( progress == 100 ) {
$('.itemBarraFreteGratis .iconeFreteGratis').addClass('ganhouFreteGratis efeitoPulsar');
$('.textosFreteGratis').addClass('ganhouFreteGratisTexto vibrar');
} else {
$('.itemBarraFreteGratis .iconeFreteGratis').removeClass('ganhouFreteGratis efeitoPulsar');
$('.textosFreteGratis').removeClass('ganhouFreteGratisTexto vibrar');
}
}
function retorna_core_progresso(progress)
{
const startColor = [179, 217, 179]; // Red (RGB)
const endColor = [0, 166, 80]; // Green (RGB)
const r = Math.round(startColor[0] + (endColor[0] - startColor[0]) * (progress / 100));
const g = Math.round(startColor[1] + (endColor[1] - startColor[1]) * (progress / 100));
const b = Math.round(startColor[2] + (endColor[2] - startColor[2]) * (progress / 100));
return `rgb(${r}, ${g}, ${b})`;
}
history.scrollRestoration = 'manual';
var compra_rapida = null;
var hcaptcha_widget_id = null;
$(function() {
//Roda os vídeos da listagem quando os mesmos aparecerem na tela
var iframes = document.querySelectorAll('iframe.imgPrincipalListagem');
var observer = new IntersectionObserver(playVideoWhenVisible, { threshold: 0.5 });
iframes.forEach(iframe => {
observer.observe(iframe);
});
$(window).on('wheel DOMMouseScroll touchstart', function () {
$htmlBody.stop();
});
jQuery.ajaxSetup({
type: "post",
dataType: "json",
beforeSend: function() {
processandoDialog.create();
},
complete: function() {
if( compra_rapida == null )
{
processandoDialog.remove();
}
},
error: function() {
processandoDialog.remove();
}
});
var maskTelefone = function (val) {
val = val.replace(/\D/g, '');
if (val.substr(0, 4) == '0800') {
return '0000 000 0000';
}
else if (val.length === 11) {
return '(00) 00000-0000';
} else {
return '(00) 0000-00009';
}
},
options = {
onKeyPress: function (val, e, field, options) {
field.mask(maskTelefone.apply({}, arguments), options);
}
};
$('input.mascaraTelefone').mask(maskTelefone, options);
$('.textNotInput.mascaraTelefone').each(function(){
$(this).mask(maskTelefone($(this).text()));
});
$('.textNotInput.mascaraWhatsapp').each(function(){
var img = $(this).children("img");
$(this).mask(maskTelefone($(this).text()));
$(this).append(img);
});
// Verifica se o navegador é o Internet Explorer
// Caso positivo, aplica classes que corrigem a exibição do conteúdo dos elementos
var isIE11 = !!navigator.userAgent.match(/Trident.*rv\:11\./);
if ( isIE11 == true)
{
$('.tipoColunasDivisor13 :nth-child(1).colunaDivisor').css('max-width','none');
$('.elementoInformacao div').css('display','block');
}
ajustaAlturaConteudoMeio();
$(window).on('load', function(){
ajustaAlturaConteudoMeio();
setTimeout(function(){
//Verifica se existe hCaptcha na tela
//Caso positivo: Insere o widget_id na variável global "hcaptcha_widget_id" para utilização nas páginas da loja
if(typeof $('iframe').attr('data-hcaptcha-widget-id') != 'undefined'){
var widget_id = $('iframe').attr('data-hcaptcha-widget-id');
if(widget_id != null || widget_id != NULL){
hcaptcha_widget_id = widget_id
}
}
},100);
});
// Chama a função que exibe o processando enquanto o modal do magnific popup é carregado e exibido
$('body').on('click', '.iframePopUp, .iframePopUpNoClose', function(a){
a.preventDefault();
processandoDialog.create();
setTimeout(function(){
loaderMagnificPopup();
}, 1500);
});
$('.iframePopUp:not(.iframePopUpEsqueciMinhaSenha)').magnificPopup({
type: 'iframe'
});
$('.iframePopUpDuvida, .iframePopUpEsqueciMinhaSenha').magnificPopup({
type: 'iframe',
callbacks: {
open: function() {
$('.mfp-content').addClass('modalDuvida');
$('.mfp-iframe-holder .mfp-content').css('opacity','1');
},
},
});
// Chama a função que exibe o processando enquanto o modal do magnific popup é carregado e exibido
$('body').on('click', '.iframePopUpDuvidaSobConsulta', function(){
$('.iframePopUpDuvida').trigger('click');
});
verificaDispositivoIos();
//Fecha o item da vitrine Flutuante ao clicar no "X"
$('body').on('click', '.fechaItemVitrine', function () {
$('#boxVitrineFlutuante').removeClass('exibe');
//Interrompe o ciclo de exibição de produtos
if(typeof intervalVT != 'undefined'){
clearInterval(intervalVT);
}
});
$('body').on('click', '.boxBotaoVerSenhaInput:not(.topoLogin)', function(a) {
a.preventDefault();
a.stopPropagation();
if ($(this).hasClass('ativo')) {
$(this).removeClass('ativo');
$(this).siblings('#desc_senha, [name="desc_senha"], [name="desc_senha_cadastro"]').attr('type', 'password');
} else {
$(this).addClass('ativo');
$(this).siblings('#desc_senha, [name="desc_senha"], [name="desc_senha_cadastro"]').attr('type', 'text');
}
});
});
;
var buscaProdutosModule = (function($) {
var stringBusca = '';
var timer = 0;
var $inputBusca = $('#inputBusca');
var $divInsertAfter = $('#inputBusca');
var valorBusca = null;
/**
*
* @param arrayProdutos
* @private
*/
var _criaResultadoBusca = function(arrayProdutos) {
$('.boxBuscaExpandida').remove();
var $boxBuscaExpandida = $('');
var $elemItemVerTodos = $('
VER TODOS
');
$.each(arrayProdutos, function(index, elem) {
var $elemDiv = $('